|
For many command line interpreters (“shell”) of Unix operating systems, the internal field separator (abbreviated IFS) refers to a variable which defines the character or characters used to separate a pattern into tokens for some operations. IFS typically includes the space, tab, and the newline. From the bash man page:
IFS was usable as an exploit in some versions of Unix. A program with root permissions could be fooled into executing user-supplied code if it ran (for instance) system("/bin/mail") and was called with $IFS set to "/", in which case it would run the program "bin" (in the current directory and thus writable by the user) with root permissions.〔http://www.win.tue.nl/~aeb/linux/hh/hh-8.html#ss8.7〕 This has been fixed by making the shells not inherit the IFS variable.==External links== Some examples on how to apply the use of IFS in Bash scripts: * http://tldp.org/LDP/abs/html/internalvariables.html * http://mindspill.net/computing/linux-notes/using-the-bash-ifs-variable-to-make-for-loops-split-with-non-whitespace-characters/ * http://www.cyberciti.biz/faq/bash-for-loop-spaces/ 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Internal field separator」の詳細全文を読む スポンサード リンク
|